<template>
	<!-- 风险清单 -->
	<view class="p-10">
		<template v-if="list.length > 0">
			<view class="card" v-for="(item,index) in list" @click="goDetail(item)">
				<view class="flex m-between">
					<view class="name fw">
						{{selectDictLabel(checkList, item.riskLocationId)}}
					</view>
					<view class="grade fw"> 风险等级: {{item.riskLevelName}}
					</view>
				</view>
				<view class="flex m-between m-t-8">
					<view class="post"> 项目: {{item.projectInfo}}
					</view>
					<view class="pro"> 风险值: {{ item.riskValue}}
					</view>
				</view>
				<view class="flex m-between m-t-8"> 风险描述: <up-text :lines="2" :text="item.remark"></up-text>
				</view>
			</view>
		</template>
		<u-empty v-else mode="data">
		</u-empty>
	</view>
	<u-back-top :scroll-top="scrollTop" top="600"></u-back-top>
</template>
<script setup>
	import {
		onShow,
	} from '@dcloudio/uni-app'
	import {
		reactive,
	} from "vue";
	import {
		userRiskPage
	} from '@/api/user.js'
	import useList from '@/hooks/useList.js'
	import {
		selectDictLabel
	} from '@/utils/url.js'

	let queryParams = reactive({
		pageNum: 1,
		pageSize: 10
	})
	const {
		getListData,
		list,
		scrollTop,
		getCheckPonit,
		checkList
	} = useList({
		queryParams,
		api: {
			page: userRiskPage
		}
	})
	// 跳转详情
	const goDetail = (item) => {
		uni.navigateTo({
			url: '/pages/professional/risk/list/detail?data=' + JSON.stringify(item)
		})
	}
	onShow(() => {
		getCheckPonit()
		getListData()
	})
</script>
<style lang="scss" scoped>
</style>